package com.xaicode.template.security.repository;

import com.xaicode.template.security.entity.SysUser;
import org.springframework.data.repository.CrudRepository;

/**
 * @author Locker
 * @date 2021/8/19 0019 18:02
 */
public interface SysUserRepository extends CrudRepository<SysUser, Long> {

    SysUser findByUsername(String username);

    /**
     * Returns all instances of the type.
     *
     * @return all entities
     */
    @Override
    Iterable<SysUser> findAll();

    /**
     * Deletes a given entity.
     *
     * @param entity must not be {@literal null}.
     * @throws IllegalArgumentException in case the given entity is {@literal null}.
     */
    @Override
    void delete(SysUser entity);
}
